package com.lc.sms.handle;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.profile.DefaultProfile;
import com.lc.sms.common.constant.SmsConstant;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @description: some desc
 * @author: LChuang
 * @date: 2023/9/22 15:40
 */
@Configuration
public class SmsConfig {

    @Bean
    public IAcsClient aliSmsClient(){
        DefaultProfile profile = DefaultProfile.getProfile(SmsConstant.REGION_ID, SmsConstant.ACCESS_KEY_ID, SmsConstant.ACCESS_KEY_SECRET);
        DefaultProfile.addEndpoint(SmsConstant.REGION_ID, SmsConstant.PRODUCT, SmsConstant.DOMAIN);
        return new DefaultAcsClient(profile);
    }

}
